<!DOCTYPE html>
<script src="../../../resources/run-after-layout-and-paint.js"></script>
<script src="../resources/text-based-repaint.js"></script>
<script>
function repaintTest() {
  getSelection().removeAllRanges();
}
onload = function() {
  getSelection().selectAllChildren(document.getElementById('div'));
  runAfterLayoutAndPaint(function() {
    document.getElementById('div').style.top = '300px';
    runRepaintAndPixelTest();
  });
};
</script>
<style>
img {
  vertical-align: text-bottom;
  width: 50px;
  height: 50px;
}
div {
  position: absolute;
  top: 100px;
  left: 100px;
}
</style>
Tests paint invalidation of selection when its cleared after the container is moved.<br>
Passes if no selection left.
<div id="div">
  <img></img>
</div>
